<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var obj = {
            name: 'lilei',
            age: 20,
            sister: {
                name: 'hanmeimei',
                age: 21
            }
        }

        function clone(obj){
            var newObj = {}
            for(var key in obj){
                newObj[key] = obj[key]
            }
            return newObj 
        }

        var obj1 = clone(obj)
        console.log(obj1.sister === obj.sister)
    </script>
</body>

</html>